﻿<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <title>注册程序之表单页面</title>
</head>
<body>
<%
    String userId = "";
    String password = "";
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        for (int i = 0; i < cookies.length; i++) {
            if (cookies[i].getName().equals("Cookie2019")) {
                //如果cookie对象的名称为Cookie2019
                userId = cookies[i].getValue().split("#")[0];  //获取用户名
                password = cookies[i].getValue().split("#")[1];  //获取密码
            }
        }
    }
%>
<center>
    <h1>注册操作</h1>
    <hr>
    <form action="register_check.jsp" method="post">
        <table border="1">
            <tr>
                <td colspan="2">用户注册</td>
            </tr>
            <tr>
                <td>登录ID：</td>
                <td><input type="text" name="id" value="<%=userId%>"></td>
            </tr>
            <tr>
                <td>真实姓名：</td>
                <td><input type="text" name="name"></td>
            </tr>
            <tr>
                <td>性别：</td>
                <td>
                    <label><input type="radio" name="gender" value="男">男</label>
                    <label><input type="radio" name="gender" value="女">女</label>
                </td>
            </tr>
            <tr>
                <td>E-Mail:</td>
                <td><input type="email" name="email"></td>
            </tr>
            <tr>
                <td>登录密码：</td>
                <td><input type="password" name="password1" value="<%=password%>"></td>
            </tr>
            <tr>
                <td>确认密码：</td>
                <td><input type="password" name="password2"></td>
            </tr>
            <tr>
                <td colspan="2">
                    <center>
                        <input type="submit" value="注册">&nbsp;
                        <input type="reset" value="重置">&nbsp;
                        <input type="button" value="返回" onclick="window.location.href = 'login.jsp'">
                    </center>
                </td>
            </tr>
        </table>
    </form>
</center>
</body>
</html>
